package Utils

import org.apache.spark.{SparkConf, SparkContext}

object SparkUtils {

    def getSparkContext(i:Int,name:String) = {

      val sparkConf = new SparkConf()
      sparkConf.setMaster(s"local[${i}]").setAppName(name)
      val sc = new SparkContext(sparkConf)
      sc //作为方法的返回值
    }

}
